package com.momo.mapper.mapper;

import com.momo.mapper.dataobject.UserDO;
import org.apache.ibatis.annotations.Param;

/**
 * 由于需要对分页支持,请直接使用对应的DAO类
 * 注意:此结构有系统生成,禁止手工修改,以免被覆盖,请通过dalgen生成
 * The Table USER.
 * USER
 */
public interface UserDOMapper{

    /**
     * desc:插入表:USER.<br/>
     * descSql =  INSERT INTO user( NICKNAME ,PASSWORD ,USERNAME )VALUES( #{nickname,jdbcType=VARCHAR} ,#{password,jdbcType=VARCHAR} ,#{username,jdbcType=VARCHAR} )
     * @param entity entity
     * @return int
     */
    int insert(UserDO entity);
    /**
     * desc:更新表:USER.<br/>
     * descSql =  UPDATE USER SET NICKNAME = #{nickname,jdbcType=VARCHAR} ,PASSWORD = #{password,jdbcType=VARCHAR} ,USERNAME = #{username,jdbcType=VARCHAR} WHERE ID = #{id,jdbcType=BIGINT}
     * @param entity entity
     * @return int
     */
    int update(UserDO entity);
    /**
     * desc:根据主键删除数据:USER.<br/>
     * descSql =  DELETE FROM USER WHERE ID = #{id,jdbcType=BIGINT}
     * @param id id
     * @return int
     */
    int deleteById(Long id);
    /**
     * desc:根据主键获取数据:USER.<br/>
     * descSql =  SELECT * FROM USER WHERE ID = #{id,jdbcType=BIGINT}
     * @param id id
     * @return UserDO
     */
    UserDO getById(Long id);
    /**
     * desc:根据主键获取数据:USER.<br/>
     * descSql =  SELECT * FROM user WHERE username = #{username,jdbcType=VARCHAR}
     * @param username username
     * @return UserDO
     */
    UserDO findByUsername(String username);
}
